<?php

class LevelStudyKitPeer extends BaseLevelStudyKitPeer
{
	public static function getListLevelKitWithLevel( $level_id, $lang_current, $start=1, $limit = 10 )
	{
		//b.course_name, b.description,level.ID, level.COURSE_ID, level.LEVEL_PRICE, level.LEVEL_STATUS, level.CREATE_AT, level.UPDATE_AT, level_i18n.ID, level_i18n.CULTURE, level_i18n.LEVEL_NAME, level_i18n.LEVEL_DESCRIPTION, level_i18n.VOCABULARY, level_i18n.FLUENCE, level_i18n.GRAMMAR
		return DbFinder::from('LevelStudyKit a')
		->with('I18n')
		->where('a.lskStatus',1)
		->where('a.levelId', $level_id )
		->orderBy('a.id', 'Asc')
		//->useCache(sfConfig::get('sf_cache'), 200)
		->paginate($start, $limit);
	}
	//get Level name have levelID
	public static function getLevelNameById( $level_id )
	{
		$level = DbFinder::from('Level a')
				->with('I18n')
				->where('a.levelStatus',1)
				->findPk( $level_id  )
				;	
		if( isset($level) )
			return $level->getLevelName();
	}
}
